var express = require("express");
const { Op } = require("sequelize");
var router = express.Router();

const { DishType } = require("../models");
const { NotFoundError, success, failure } = require("../utils/response");

/**
 * 查询文章列表
 * 根据title模糊搜索
 */
router.post("/all", async function (req, res, next) {
  try {
    // 通过模型获取数据
    const data = await DishType.findAll();
    // 响应数据
    success(res, "查询列表成功", data);
  } catch (error) {
    failure(res, error);
  }
});

module.exports = router;
